﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Runtime.Remoting;
using BDElectron.Remote;
using BDElectron.Platform;

namespace BDElectron.Client
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            IServerObject mServerObject = null;

            Logger.LogInfo("Client application - starting.");
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            LoghinForm loginWindow = new LoghinForm(); 
                        
            // If login is successful
            if (loginWindow.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                mServerObject = (IServerObject)loginWindow.ServerObject;

                Logger.LogInfo("Client application - login successful.");

                Application.Run(new MainForm(mServerObject));
            }


            
        }
    }
}
